#ifndef GAMEENGINE_GRAPHICS_SCENE_SCENE_H
#define GAMEENGINE_GRAPHICS_SCENE_SCENE_H

#include <GameEngine/Graphics/graphics_settings.h>
#include <GameEngine/Graphics/Scene/scene_element.h>

#include <QtCore/QList>


#ifdef GAMEENGINE_NAMESPACES
namespace GameEngine {
#endif


//! A scene consists in the set of objects which has to be drawn in a given context
/*!
 *  The elements are drawn in the following order: first the lights, then the opaque
 *  geometry, then the transparent geometry. The type of the element being drawn is
 *  checked with the SceneElement::type() function.
 */
class _Graphics_decl Scene {

public:
	Scene();
	Scene(const Scene& rhs);
	Scene& operator=(const Scene& rhs);
	virtual ~Scene();

	virtual bool prepare_scene();
	virtual bool draw_scene(const Line3d<float>& ray);
	virtual bool finish_scene();

	virtual bool add_element(SceneElement* element, int position = 0);
	virtual bool remove_element(SceneElement* element);
	virtual bool find_element(SceneElement* element) const;

	const QList<SceneElement*>& scene_elements() const;

protected:
	//! The list of the elements that should be drawn by the scene
	QList<SceneElement*> scene_elements_;
};


#ifdef GAMEENGINE_NAMESPACES
} // namespace GameEngine
#endif

#endif
